package sum.book.common.core.model.dto;

import lombok.Data;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

@Data
public class ImportDTO implements Serializable {

	private static final long serialVersionUID = 1L;

	public ImportDTO() {
		this.successCount = 0;
		this.failCount = 0;
		this.repeatCount = 0;
		this.failList = new ArrayList<>();
	}

	/**
	 * 成功数
	 */
	private Integer successCount;
	/**
	 * 失败数
	 */
	private Integer failCount;
	/**
	 * 重复数
	 */
	private Integer repeatCount;
	/**
	 * 导入结果sign
	 */
	private String importSign;

	/**
	 * 导入失败记录列表
	 */
	private List<ImportExceptionDTO> failList;

	/**
	 * 成功条数自增
	 */
	public void saveCountGetAndIncrement() {
		this.successCount++;
	}

	/**
	 * 失败条数自增
	 */
	public void failCountGetAndIncrement() {
		this.failCount++;
	}

	/**
	 * 重复条数自增
	 */
	public void repeatCountGetAndIncrement() {
		this.repeatCount++;
	}
}
